package ltd.smallwang;

import org.assertj.core.api.Assertions;
import org.junit.jupiter.api.Test;

/**
 * @author justd
 * @date 2024-10-06 09:27
 */
class Leetcode0238Test {

  private final Leetcode0238 leetcode0238 = new Leetcode0238();

  @Test
  void productExceptSelf01() {
    Assertions.assertThat(leetcode0238.productExceptSelf(new int[]{1, 2, 3, 4}))
        .containsExactly(24, 12, 8, 6);
  }

  @Test
  void productExceptSelf02() {
    Assertions.assertThat(leetcode0238.productExceptSelf(new int[]{-1, 1, 0, -3, 3}))
        .containsExactly(0, 0, 9, 0, 0);
  }

  @Test
  void productExceptSelf03() {
    Assertions.assertThat(leetcode0238.productExceptSelf(new int[]{-1, 1}))
        .containsExactly(1, -1);
  }
}